/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;
 
import Model.TiendaM;
import View.gestion.frmModelo;
import View.venta.frmMovimientoAlmacen;
import View.venta.frmMovimientoCaja;
import View.venta.frmReportes;
import View.venta.frmVenta;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import javax.swing.ImageIcon;
import javax.swing.JFrame;

/**
 *
 * @author Maryluz
 */
public class frmMenuPrincipal extends javax.swing.JFrame {

    ImageIcon icon ;
    SimpleDateFormat formateador = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a", new Locale("ES"));
    Date fechaDate = new Date();
    String fecha = formateador.format(fechaDate);
    int idT;
    TiendaM oMT;
    
    public frmMenuPrincipal(int idTienda, TiendaM oM) {
        initComponents();
        idT=idTienda;
        oM.setIdTienda(idT); 
        oMT=oM;
        icon = new ImageIcon(getClass().getResource("/Image/SysRealeza2.png"));
        this.setIconImage(icon.getImage()); 
        this.setExtendedState(JFrame.MAXIMIZED_BOTH);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jButton3 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jXStatusBar1 = new org.jdesktop.swingx.JXStatusBar();
        jPanel3 = new javax.swing.JPanel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar();
        btnVenta = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/delivery.png"))); // NOI18N
        jButton3.setText("Compra");
        jButton3.setFocusable(false);
        jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton3.setIconTextGap(3);
        jButton3.setMaximumSize(new java.awt.Dimension(90, 90));
        jButton3.setMinimumSize(new java.awt.Dimension(77, 70));
        jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/home.png"))); // NOI18N
        jButton1.setText("Inicio");
        jButton1.setFocusable(false);
        jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton1.setIconTextGap(3);
        jButton1.setMaximumSize(new java.awt.Dimension(90, 90));
        jButton1.setMinimumSize(new java.awt.Dimension(77, 70));
        jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        jButton7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/system_help.png"))); // NOI18N
        jButton7.setText("Ayuda");
        jButton7.setFocusable(false);
        jButton7.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton7.setIconTextGap(2);
        jButton7.setMaximumSize(new java.awt.Dimension(90, 90));
        jButton7.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        jXStatusBar1.setMinimumSize(new java.awt.Dimension(27, 22));
        jXStatusBar1.setPreferredSize(new java.awt.Dimension(27, 22));

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("SysRealeza .::. Sistema Textil  .::. MODULO DE VENTAS");

        jPanel3.setLayout(new java.awt.BorderLayout());
        jPanel3.add(jSeparator1, java.awt.BorderLayout.PAGE_START);

        jLabel1.setBackground(new java.awt.Color(0, 0, 0));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Pantalla.jpg"))); // NOI18N
        jLabel1.setToolTipText("");
        jLabel1.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jLabel1.setOpaque(true);
        jPanel3.add(jLabel1, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPanel3, java.awt.BorderLayout.CENTER);

        jPanel1.setPreferredSize(new java.awt.Dimension(776, 100));
        jPanel1.setLayout(new java.awt.BorderLayout());

        jPanel4.setMinimumSize(new java.awt.Dimension(645, 110));
        jPanel4.setPreferredSize(new java.awt.Dimension(545, 110));
        jPanel4.setLayout(new java.awt.BorderLayout());

        jToolBar1.setBackground(new java.awt.Color(0, 0, 0));
        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);
        jToolBar1.setMaximumSize(new java.awt.Dimension(405, 110));
        jToolBar1.setMinimumSize(new java.awt.Dimension(405, 110));
        jToolBar1.setPreferredSize(new java.awt.Dimension(405, 110));

        btnVenta.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnVenta.setForeground(new java.awt.Color(255, 255, 255));
        btnVenta.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/buy.png"))); // NOI18N
        btnVenta.setText("VENTA");
        btnVenta.setFocusable(false);
        btnVenta.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnVenta.setIconTextGap(3);
        btnVenta.setMaximumSize(new java.awt.Dimension(110, 90));
        btnVenta.setMinimumSize(new java.awt.Dimension(110, 90));
        btnVenta.setOpaque(false);
        btnVenta.setPreferredSize(new java.awt.Dimension(110, 90));
        btnVenta.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnVenta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVentaActionPerformed(evt);
            }
        });
        jToolBar1.add(btnVenta);

        jButton4.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jButton4.setForeground(new java.awt.Color(255, 255, 255));
        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/maintenance_time.png"))); // NOI18N
        jButton4.setText("<HTML>REGISTRO DE <BR> &nbsp; &nbsp;PRENDAS</HTML>");
        jButton4.setFocusable(false);
        jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton4.setIconTextGap(3);
        jButton4.setMaximumSize(new java.awt.Dimension(110, 90));
        jButton4.setMinimumSize(new java.awt.Dimension(110, 90));
        jButton4.setOpaque(false);
        jButton4.setPreferredSize(new java.awt.Dimension(110, 90));
        jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton4);

        jButton5.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jButton5.setForeground(new java.awt.Color(255, 255, 255));
        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/search.png"))); // NOI18N
        jButton5.setFocusable(false);
        jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton5.setIconTextGap(3);
        jButton5.setLabel("<HTML>MOVIMIENTOS DE <BR>&nbsp; &nbsp; &nbsp; &nbsp;ALMACEN</HTML>");
        jButton5.setMaximumSize(new java.awt.Dimension(130, 90));
        jButton5.setMinimumSize(new java.awt.Dimension(100, 79));
        jButton5.setOpaque(false);
        jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton5);

        jButton8.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jButton8.setForeground(new java.awt.Color(255, 255, 255));
        jButton8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/printer.png"))); // NOI18N
        jButton8.setText("<HTML>  &nbsp; &nbsp; &nbsp; INGRESOS Y <BR> EGRESOS DE CAJA</HTML>");
        jButton8.setFocusable(false);
        jButton8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton8.setIconTextGap(3);
        jButton8.setMaximumSize(new java.awt.Dimension(110, 90));
        jButton8.setMinimumSize(new java.awt.Dimension(110, 90));
        jButton8.setOpaque(false);
        jButton8.setPreferredSize(new java.awt.Dimension(110, 90));
        jButton8.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton8);

        jButton6.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jButton6.setForeground(new java.awt.Color(255, 255, 255));
        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Image/Ico.png"))); // NOI18N
        jButton6.setText("REPORTES");
        jButton6.setFocusable(false);
        jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton6.setIconTextGap(2);
        jButton6.setMaximumSize(new java.awt.Dimension(110, 90));
        jButton6.setMinimumSize(new java.awt.Dimension(110, 90));
        jButton6.setOpaque(false);
        jButton6.setPreferredSize(new java.awt.Dimension(110, 90));
        jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });
        jToolBar1.add(jButton6);

        jPanel4.add(jToolBar1, java.awt.BorderLayout.PAGE_START);

        jPanel1.add(jPanel4, java.awt.BorderLayout.LINE_END);

        jPanel5.setBackground(new java.awt.Color(0, 0, 0));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 859, Short.MAX_VALUE)
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        jPanel1.add(jPanel5, java.awt.BorderLayout.CENTER);

        getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnVentaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVentaActionPerformed
       new frmVenta(idT, oMT).setVisible(true);
       this.dispose();
    }//GEN-LAST:event_btnVentaActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        new frmModelo(this, true).setVisible(true); 
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        new frmMovimientoAlmacen(this, true, fecha, "", oMT).setVisible(true); 
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        new frmReportes(this, true,oMT).setVisible(true);
        ///new frmMovimientoAlmacen(this, true, fecha, "").setVisible(true); 
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        new frmMovimientoCaja(this, true, idT,oMT).setVisible(true);
    }//GEN-LAST:event_jButton8ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnVenta;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JToolBar jToolBar1;
    private org.jdesktop.swingx.JXStatusBar jXStatusBar1;
    // End of variables declaration//GEN-END:variables
}
